<?php
function MoveFiles($dir) {
  foreach($_REQUEST['files'] as $file) {
    if(!@rename("{$_SESSION['dir']}$file", "{$_SESSION['dir']}$dir".strrchr($file,"/")))
			die("Error: Unable to move files!\nExecution Stopped on moving file: $dir".strrchr($file,"/")."!");
  }
  echo "Success: [".count($_REQUEST['files'])."] Files moved successfully!";
}

require_once('../../conf/main.conf.php');
if(isset($_REQUEST['files']) && !empty($_REQUEST['files']) && isset($_REQUEST['destdir']) && !empty($_REQUEST['destdir'])) {
  MoveFiles($_REQUEST['destdir']);
}
else die("Unauthorized access");

?>
